package com.ruoyi.project.lely.bean.entity;

import com.baomidou.mybatisplus.annotation.*;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.math.BigDecimal;
import java.time.LocalDateTime;
import javax.validation.constraints.Digits;
import javax.validation.constraints.NotNull;
import org.hibernate.validator.constraints.Length;

/**
 * 账户流水
 *
 * @author luoyong
 */
@Builder
@AllArgsConstructor
@NoArgsConstructor
@Data
@TableName(value = "`ly_account_trace`", autoResultMap = true)
public class LyAccountTrace {


    @ApiModelProperty("ID")
    @TableId("id")
    private Long id;


    @Length(max = 50, message = "操作流水长度不能超过50位")
    @ApiModelProperty("操作流水")
    @TableField(value = "`trace_sn`")
    private String traceSn;


    @NotNull
    @ApiModelProperty("用户表的用户ID")
    @TableField(value = "`user_id`")
    private Integer userId;


    @ApiModelProperty("操作类型 0:系统结算 1:用户提现")
    @TableField(value = "`type`")
    private Integer type;


    @Digits(integer = 10 - 2, fraction = 2)
    @ApiModelProperty("操作金额")
    @TableField(value = "`amount`")
    private BigDecimal amount;


    @Digits(integer = 10 - 2, fraction = 2)
    @ApiModelProperty("总申请金额")
    @TableField(value = "`total_amount`")
    private BigDecimal totalAmount;


    @ApiModelProperty("申请时间")
    @TableField(value = "`create_time`", fill = FieldFill.INSERT)
    private LocalDateTime createTime;


    @Length(max = 20, message = "手机号长度不能超过20位")
    @ApiModelProperty("手机号")
    @TableField(value = "`mobile`")
    private String mobile;


    @Length(max = 10, message = "短信提取码长度不能超过10位")
    @ApiModelProperty("短信提取码")
    @TableField(value = "`sms_code`")
    private String smsCode;


    @ApiModelProperty("审批状态")
    @TableField(value = "`status`")
    private Integer status;


    @Length(max = 255, message = "消息内容长度不能超过255位")
    @ApiModelProperty("消息内容")
    @TableField(value = "`trace_msg`")
    private String traceMsg;


    @ApiModelProperty("审批时间")
    @TableField(value = "`update_time`", fill = FieldFill.INSERT_UPDATE)
    private LocalDateTime updateTime;

}
